﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;

namespace IRCBot
{
    public partial class ConsoleLog : Form
    {

        Thread gcT;

        TcpClient gcClient;
        NetworkStream gcStream;
        StreamReader gcInput;
        StreamWriter gcOutput;

        void StartChatParse(string server, int port)
        {
            Log("Opening connection to Glider");
            gcClient = new TcpClient(server, port);
            if (gcClient.Connected)
            {
                Log("Connected to Glider");
                gcT = new Thread(new ThreadStart(ChatHandler));
                gcT.Start();
            }
        }

        void ChatHandler()
        {
            gcStream = gcClient.GetStream();
            gcOutput = new StreamWriter(gcStream);
            gcInput = new StreamReader(gcStream);
            gcOutput.WriteLine(gPass);
            gcOutput.Flush();

            while (gcClient.Connected)
            {
            }
        }
    }
}